﻿<!--
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.
-->

<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="using:WinRTXamlToolkit.Controls"
    xmlns:controlsPrimitives="using:WinRTXamlToolkit.Controls.Primitives">
    <ResourceDictionary.ThemeDictionaries>
        <ResourceDictionary
            x:Key="Light">
            <SolidColorBrush
                x:Key="CalendarDayTodayBackgroundFillBrush"
                Color="Transparent" />
            <SolidColorBrush
                x:Key="CalendarDayTodayBackgroundStrokeBrush"
                Color="#80000000" />
            <SolidColorBrush
                x:Key="CalendarDaySelectedBackgroundFillBrush"
                Color="#40000000" />
            <SolidColorBrush
                x:Key="CalendarDayBackgroundHighlightBrush"
                Color="#20000000" />
            <SolidColorBrush
                x:Key="CalendarDayForeground"
                Color="#FF000000" />
            <SolidColorBrush
                x:Key="CalendarDayBlackoutVisualFill"
                Color="#A0000000" />
        </ResourceDictionary>
        <ResourceDictionary
            x:Key="Default">
            <SolidColorBrush
                x:Key="CalendarDayTodayBackgroundFillBrush"
                Color="Transparent" />
            <SolidColorBrush
                x:Key="CalendarDayTodayBackgroundStrokeBrush"
                Color="#80FFFFFF" />
            <SolidColorBrush
                x:Key="CalendarDaySelectedBackgroundFillBrush"
                Color="#40FFFFFF" />
            <SolidColorBrush
                x:Key="CalendarDayBackgroundHighlightBrush"
                Color="#20FFFFFF" />
            <SolidColorBrush
                x:Key="CalendarDayForeground"
                Color="#FFFFFFFF" />
            <SolidColorBrush
                x:Key="CalendarDayBlackoutVisualFill"
                Color="#A0FFFFFF" />
        </ResourceDictionary>
    </ResourceDictionary.ThemeDictionaries>

    <x:Double
        x:Key="CalendarDayTodayStrokeThickness">2</x:Double>
    <x:Double
        x:Key="CalendarDayButtonFontSize">36</x:Double>

    <!-- CalendarDayButton Style -->
    <Style
        TargetType="controlsPrimitives:CalendarDayButton">
        <Setter
            Property="FontFamily"
            Value="{StaticResource ContentControlThemeFontFamily}" />
        <Setter
            Property="FontSize"
            Value="{StaticResource CalendarDayButtonFontSize}" />
        <Setter
            Property="HorizontalContentAlignment"
            Value="Center" />
        <Setter
            Property="VerticalContentAlignment"
            Value="Center" />
        <Setter
            Property="Padding"
            Value="15,5" />
        <Setter
            Property="MinWidth"
            Value="70" />
        <Setter
            Property="Template">
            <Setter.Value>
                <ControlTemplate
                    TargetType="controlsPrimitives:CalendarDayButton">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup
                                x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition
                                        From="Normal"
                                        GeneratedDuration="0:0:0"
                                        To="PointerOver" />
                                </VisualStateGroup.Transitions>
                                <VisualState
                                    x:Name="Normal" />
                                <VisualState
                                    x:Name="PointerOver">
                                    <Storyboard>
                                        <DoubleAnimation
                                            Duration="0"
                                            Storyboard.TargetName="Background"
                                            Storyboard.TargetProperty="Opacity"
                                            To=".3" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState
                                    x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation
                                            Duration="0"
                                            Storyboard.TargetName="Background"
                                            Storyboard.TargetProperty="Opacity"
                                            To=".3" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState
                                    x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation
                                            Duration="0"
                                            Storyboard.TargetName="Background"
                                            Storyboard.TargetProperty="Opacity"
                                            To="0" />
                                        <DoubleAnimation
                                            Duration="0"
                                            Storyboard.TargetName="Content"
                                            Storyboard.TargetProperty="Opacity"
                                            To=".35" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup
                                x:Name="SelectionStates">
                                <VisualState
                                    x:Name="Unselected" />
                                <VisualState
                                    x:Name="Selected">
                                    <Storyboard>
                                        <DoubleAnimation
                                            Duration="0"
                                            Storyboard.TargetName="SelectedBackground"
                                            Storyboard.TargetProperty="Opacity"
                                            To=".75" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup
                                x:Name="CalendarButtonFocusStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition
                                        From="CalendarButtonUnfocused"
                                        GeneratedDuration="0:0:0"
                                        To="CalendarButtonFocused" />
                                </VisualStateGroup.Transitions>
                                <VisualState
                                    x:Name="CalendarButtonFocused">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames
                                            Storyboard.TargetName="FocusVisualWhite"
                                            Storyboard.TargetProperty="Opacity">
                                            <SplineDoubleKeyFrame
                                                KeyTime="0"
                                                Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames
                                            Storyboard.TargetName="FocusVisualBlack"
                                            Storyboard.TargetProperty="Opacity">
                                            <SplineDoubleKeyFrame
                                                KeyTime="0"
                                                Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState
                                    x:Name="CalendarButtonUnfocused" />
                            </VisualStateGroup>
                            <VisualStateGroup
                                x:Name="ActiveStates">
                                <VisualState
                                    x:Name="Active" />
                                <VisualState
                                    x:Name="Inactive">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames
                                            Storyboard.TargetName="Content"
                                            Storyboard.TargetProperty="Opacity">
                                            <EasingDoubleKeyFrame
                                                KeyTime="0"
                                                Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup
                                x:Name="DayStates">
                                <VisualState
                                    x:Name="RegularDay" />
                                <VisualState
                                    x:Name="Today">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames
                                            Storyboard.TargetName="TodayBackground"
                                            Storyboard.TargetProperty="Opacity">
                                            <EasingDoubleKeyFrame
                                                KeyTime="0"
                                                Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup
                                x:Name="BlackoutDayStates">
                                <VisualState
                                    x:Name="NormalDay" />
                                <VisualState
                                    x:Name="BlackoutDay">
                                    <Storyboard>
                                        <DoubleAnimation
                                            Duration="0"
                                            Storyboard.TargetName="BlackoutVisual"
                                            Storyboard.TargetProperty="Opacity"
                                            To=".2" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle
                            x:Name="TodayBackground"
                            Fill="{StaticResource CalendarDayTodayBackgroundFillBrush}"
                            Stroke="{StaticResource CalendarDayTodayBackgroundStrokeBrush}"
                            StrokeThickness="{StaticResource CalendarDayTodayStrokeThickness}"
                            Opacity="0" />
                        <Rectangle
                            x:Name="SelectedBackground"
                            Fill="{StaticResource CalendarDaySelectedBackgroundFillBrush}"
                            Opacity="0" />
                        <Rectangle
                            x:Name="Background"
                            Fill="{StaticResource CalendarDayBackgroundHighlightBrush}"
                            Opacity="0" />
                        <ContentControl
                            x:Name="Content"
                            Content="{TemplateBinding Content}"
                            ContentTemplate="{TemplateBinding ContentTemplate}"
                            Foreground="{StaticResource CalendarDayForeground}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            Margin="{TemplateBinding Padding}"
                            IsTabStop="False" />
                        <Path
                            x:Name="BlackoutVisual"
                            Fill="{StaticResource CalendarDayBlackoutVisualFill}"
                            Stretch="Fill"
                            HorizontalAlignment="Stretch"
                            Margin="3"
                            VerticalAlignment="Stretch"
                            Opacity="0"
                            RenderTransformOrigin="0.5,0.5"
                            Data="M8.1772461,11.029181 L10.433105,11.029181 L11.700684,12.801641 L12.973633,11.029181 L15.191895,11.029181 L12.844727,13.999395 L15.21875,17.060919 L12.962891,17.060919 L11.673828,15.256231 L10.352539,17.060919 L8.1396484,17.060919 L10.519043,14.042364 z" />
                        <Rectangle
                            x:Name="FocusVisualWhite"
                            IsHitTestVisible="False"
                            Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}"
                            StrokeEndLineCap="Square"
                            StrokeDashArray="1,1"
                            Opacity="0"
                            StrokeDashOffset="1.5" />
                        <Rectangle
                            x:Name="FocusVisualBlack"
                            IsHitTestVisible="False"
                            Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}"
                            StrokeEndLineCap="Square"
                            StrokeDashArray="1,1"
                            Opacity="0"
                            StrokeDashOffset="0.5" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>